#ifndef __BASIC_H__
#define __BASIC_H__

#include "stm32f1xx_hal.h"
#include "main.h"
#include "stdio.h"

#ifdef __cplusplus
extern "C"
{
#endif


    typedef struct
    {
        GPIO_TypeDef *port;
        uint16_t pin;
    } gpio_t;
    typedef struct
    {
        TIM_HandleTypeDef *tim;
        uint16_t channel;
    } pwm_t;

#define LOGI(tag, fmt, ...) \
    printf("[%s] :" fmt "\n", tag, ##__VA_ARGS__)

    uint32_t get_ms();
    uint32_t get_us();

    void delay(uint32_t ms);
    void delay_us(uint32_t us);

#ifdef __cplusplus
}
#endif
#endif
